forum

home / developersection / forums / objective c allow to allocate object through alloc and init

Objective C allow to allocate object through alloc and init

Anonymous User 2000 18-Aug-2015

What is the difference between the following 2 ways to allocate and init an object?

AController *tempAController = [[AController alloc] init];

self.aController = tempAController;

[tempAController release];

and

self.aController= [[AController alloc] init];

Most of the apple example use the first method. Why would you allocate, init and object and then release immediately?


Updated on 18-Aug-2015

I am a content writter !


Message
Can you answer this question?

Answer

0 Answers

Liked By